using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._UtilityNetworkTools
{
    /// <summary>
    /// <para>Add Trace Locations</para>
    /// <para>Creates a feature class to be used as the starting points and barriers input for the Trace tool.</para>
    /// <para>创建一个要素类，以用作追踪工具的起点和障碍输入。</para>
    /// </summary>    
    [DisplayName("Add Trace Locations")]
    public class AddTraceLocations : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AddTraceLocations()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_utility_network">
        /// <para>Input Utility Network</para>
        /// <para>The input utility network where the trace locations will be added.</para>
        /// <para>将在其中添加追踪位置的输入公共设施网络。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para><xdoc>
        ///   <para>The output feature class containing the trace locations. If you specify a new feature class name, a new output feature class will be created.</para>
        ///   <para>To use an existing feature class that was previously created by this tool and append or overwrite the existing locations, specify the name of the existing feature class.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含追踪位置的输出要素类。如果指定新的要素类名称，则将创建新的输出要素类。</para>
        ///   <para>要使用之前由此工具创建的现有要素类并追加或覆盖现有位置，请指定现有要素类的名称。</para>
        /// </xdoc></para>
        /// </param>
        public AddTraceLocations(object _in_utility_network, object _out_feature_class)
        {
            this._in_utility_network = _in_utility_network;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Utility Network Tools";

        public override string ToolName => "Add Trace Locations";

        public override string CallName => "un.AddTraceLocations";

        public override List<string> AcceptEnvironments => ["outputZFlag", "workspace"];

        public override object[] ParameterInfo => [_in_utility_network, _out_feature_class, _load_selected_features.GetGPValue(), _clear_trace_locations.GetGPValue(), _trace_locations, _filter_barrier.GetGPValue()];

        /// <summary>
        /// <para>Input Utility Network</para>
        /// <para>The input utility network where the trace locations will be added.</para>
        /// <para>将在其中添加追踪位置的输入公共设施网络。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Utility Network")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_utility_network { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para><xdoc>
        ///   <para>The output feature class containing the trace locations. If you specify a new feature class name, a new output feature class will be created.</para>
        ///   <para>To use an existing feature class that was previously created by this tool and append or overwrite the existing locations, specify the name of the existing feature class.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含追踪位置的输出要素类。如果指定新的要素类名称，则将创建新的输出要素类。</para>
        ///   <para>要使用之前由此工具创建的现有要素类并追加或覆盖现有位置，请指定现有要素类的名称。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Load Selected Features</para>
        /// <para><xdoc>
        ///   <para>Specifies whether selected features in the active map will be loaded as trace locations.
        ///   <bulletList>
        ///     <bullet_item>Checked—Trace locations will be loaded based on the selection in the map.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—Trace locations will not be loaded based on the selection in the map. This is the default. However, trace locations can be loaded using the Trace Locations parameter.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是否将活动地图中的选定要素加载为追踪位置。
        ///   <bulletList>
        ///     <bullet_item>选中 - 将根据地图中的选择加载追踪位置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会根据地图中的选择加载追踪位置。这是默认设置。但是，可以使用跟踪位置参数加载跟踪位置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Load Selected Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _load_selected_features_value _load_selected_features { get; set; } = _load_selected_features_value._false;

        public enum _load_selected_features_value
        {
            /// <summary>
            /// <para>LOAD_SELECTED_FEATURES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("LOAD_SELECTED_FEATURES")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DO_NOT_LOAD_SELECTED_FEATURES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DO_NOT_LOAD_SELECTED_FEATURES")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Clear Trace Locations</para>
        /// <para><xdoc>
        ///   <para>Specifies whether trace locations will be cleared from the output feature class.
        ///   <bulletList>
        ///     <bullet_item>Checked—Existing trace locations will be cleared.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—Existing trace locations will not be cleared; they will be kept. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是否从输出要素类中清除追踪位置。
        ///   <bulletList>
        ///     <bullet_item>选中 - 将清除现有追踪位置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会清除现有追踪位置;它们将被保留。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Clear Trace Locations")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _clear_trace_locations_value _clear_trace_locations { get; set; } = _clear_trace_locations_value._false;

        public enum _clear_trace_locations_value
        {
            /// <summary>
            /// <para>CLEAR_LOCATIONS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CLEAR_LOCATIONS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>KEEP_LOCATIONS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_LOCATIONS")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Trace Locations</para>
        /// <para><xdoc>
        ///   <para>The trace locations that will be added to the output feature class. If you are not using the Load Selected Features parameter in an active map, you can use this parameter to specify the utility network features to add as trace locations by providing the required values in the value table.</para>
        ///   <para>The trace locations properties are as follows:
        ///   <bulletList>
        ///     <bullet_item>Layer Name—The layer participating in the utility network that contains a starting point or barrier location to be added. If there is an active map, only layers from the map are allowed.  </bullet_item><para/>
        ///     <bullet_item>Global ID—The Global ID of the layer feature for the location to add.  </bullet_item><para/>
        ///     <bullet_item>Terminal ID—The terminal ID of the layer feature for the location to add.  </bullet_item><para/>
        ///     <bullet_item>Percent Along—The percent along value of the layer feature. For line features, the default value is 0.5.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将添加到输出要素类的追踪位置。如果未在活动地图中使用加载所选要素参数，则可以使用此参数通过在值表中提供所需值来指定要添加为追踪位置的公共设施网络要素。</para>
        /// <para>跟踪位置属性如下所示：
        ///   <bulletList>
        ///     <bullet_item>图层名称 - 参与公共设施网络的图层，其中包含要添加的起点或障碍位置。如果存在活动地图，则仅允许地图中的图层。 </bullet_item><para/>
        ///     <bullet_item>全局 ID - 要添加的位置的图层要素的全局 ID。</bullet_item><para/>
        ///     <bullet_item>终端 ID - 要添加的位置的图层要素的终端 ID。</bullet_item><para/>
        ///     <bullet_item>沿百分比 - 图层要素的沿百分比值。对于线要素，默认值为 0.5。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Trace Locations")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _trace_locations { get; set; } = null;


        /// <summary>
        /// <para>Filter Barrier</para>
        /// <para><xdoc>
        ///   <para>Specifies the behavior of the barriers for the trace locations.
        ///   <bulletList>
        ///     <bullet_item>Checked—The barrier behaves like a filter barrier. This is useful for subnetwork-based traces where the barrier allows the subnetwork to be evaluated first and then is applied on a second traversal of the network features, essentially acting like a filter barrier.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—The barrier behaves like a traversability barrier. Traversability barriers define the extent of subnetworks and will be evaluated on the first pass. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        ///   <para>This parameter requires ArcGIS Enterprise 10.9 or later.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定跟踪位置的屏障的行为。
        ///   <bulletList>
        ///     <bullet_item>选中 - 屏障的行为类似于过滤器屏障。这对于基于子网的追踪非常有用，在子网中，屏障允许首先评估子网，然后在网络要素的第二次遍历中应用，实质上类似于过滤器屏障。 </bullet_item><para/>
        ///     <bullet_item>未选中 - 障碍的行为类似于可遍历障碍。可遍历性障碍定义了子网的范围，并将在第一次通过时进行评估。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        ///   <para>此参数需要 ArcGIS Enterprise 10.9 或更高版本。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Filter Barrier")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _filter_barrier_value _filter_barrier { get; set; } = _filter_barrier_value._false;

        public enum _filter_barrier_value
        {
            /// <summary>
            /// <para>FILTER_BARRIER</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FILTER_BARRIER")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>TRAVERSABILITY_BARRIER</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("TRAVERSABILITY_BARRIER")]
            [GPEnumValue("false")]
            _false,

        }

        public AddTraceLocations SetEnv(object outputZFlag = null, object workspace = null)
        {
            base.SetEnv(outputZFlag: outputZFlag, workspace: workspace);
            return this;
        }

    }

}